/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.techshop.service.impl;

import com.techshop.dao.PhoneDao;
import com.techshop.model.Phone;
import com.techshop.service.PhoneService;
import java.util.List;

/**
 *
 * @author Hai-PC
 */
public class PhoneServiceImpl implements PhoneService
{    
    private PhoneDao phoneDao;    

    @Override
    public Phone getById(int phoneID)
    {
        return this.getPhoneDao().getById(phoneID);
    }

    @Override
    public boolean insert(Phone phone)
    {
        return this.getPhoneDao().insert(phone);
    }

    @Override
    public boolean update(Phone phone)
    {
        return this.getPhoneDao().update(phone);
    }

    @Override
    public boolean delete(Phone phone)
    {
        return this.getPhoneDao().delete(phone);
    }

    /**
     * @return the phoneDao
     */
    public PhoneDao getPhoneDao()
    {
        return phoneDao;
    }

    /**
     * @param phoneDao the phoneDao to set
     */
    public void setPhoneDao(PhoneDao phoneDao)
    {
        this.phoneDao = phoneDao;
    }

    @Override
    public List<Phone> getAll()
    {
        return phoneDao.getAll();
    }

    @Override
    public List<Phone> search(String name, int category, int manufacturer)
    {
        return phoneDao.search(name, category, manufacturer);
    }

    @Override
    public void updateQuantity(int phoneId, int quantity)
    {
        phoneDao.updateQuantity(phoneId, quantity);
    }

    @Override
    public void updateNumSlide(int phoneId, int numSlide)
    {
        phoneDao.updateNumSlide(phoneId, numSlide);
    }
}